import fetch from '@/config/fetch'

/**
 * 修改角色权限
 */
export const updateRolePremission = (data) => fetch('/updateRolePremission',data);

/**
 * 查询角色权限
 */
export const queryRolePremission = (roleid) => fetch('/queryRolePremission/'+roleid);
/**
 * 查询所有功能
 */
export const queryFunctions = () => fetch('/queryFunctions');
/**
 * 分页日志
 */
export const findAsLogsPage = (pageNum, pageSize) => fetch('/asLogs/findAsLogsPage/' + pageNum + '/' + pageSize);
/**
 * 查username
 */
export const findUserOne = id => fetch('/findUserOne/' + id);
/**
 * 分页条件查详细信息,代理商预付款
 */
export const selectAccountdetailPage = (accountdetail) => fetch('/asAccountdetail/selectAccountdetailPage/',
	accountdetail, 'post', '');
/**
 * 查字典表优惠
 */
export const queryByConfigType = configType => fetch('/queryByConfigType/' + configType);
/**
 * 关键词续费增加账户金额
 */
export const updateAsAccountMoeny = money => fetch('/asAccount/updateAsAccountMoeny/' + money);
/**
 *  关键词续费插入详细表
 */
export const insertasAccount = (accountdetail) => fetch('/asAccountdetail/insertasAccount', accountdetail, 'post', '');
/**
 * 分页条件查关键词数据
 */
export const findasKeywordsPage = (asKeywords) => fetch('/asKeywords/findasKeywordsPage', asKeywords, 'post', '');
/**
 * 获取所有关键字数据
 */
export const findasKeywordsAll = () => fetch('/asKeywords/findasKeywordsAll');
/**
 * 根据客户名获取所有数据
 */
export const findOneByCustomName = (customName) => fetch('/asKeywords/findOneByCustomName/' + customName, 'post', '');
/**
 * 获取购买年份列表
 */
export const findYear = () => fetch('/asKeywords/findYear');
/**
 * 获取购买是否上传苹果商城列表
 */
export const findApple = () => fetch('/asKeywords/findApple');
/**
 * 根据id查询关键词数据
 */
export const findOneasKeywords = id => fetch('/asKeywords/findOneasKeywords/' + id);
/**
 * 续费关键词
 */
export const updateasKeywordsmeonyyear = (asKeywords) => fetch('/asKeywords/updateasKeywordsmeonyyear', asKeywords, 'post', '');
/**
 * 开通关键词app
 */
export const updateasKeywords = (asKeywords) => fetch('/asKeywords/updateasKeywords', asKeywords, 'post', '');
/**
 * 插入关键词数据
 */
export const insertasKeywords = (asKeywords) => fetch('/asKeywords/insertasKeywords', asKeywords, 'post','');
/**
 * 登陆
 */
export const login = (code, pass) => fetch('/login/' + code + '/' + pass);
/**
 * 删除联系人数据
 */
export const deleteContactsByid = id => fetch('/contacts/delete/' + id);
/**
 * 根据id获取摸个代理商所有联系人
 */
export const findOneByCustomsid = id => fetch('/contacts/findOneByCustomsid/' + id);
/**
 * 根据id查询联系人数据
 */
export const findOneContacts = id => fetch('/contacts/findOne/' + id);
/**
 * 修改联系人数据
 */
export const updateContacts = (contacts) => fetch('/contacts/update', contacts, 'post', '');
/**
 * 插入联系人数据
 */
export const addContacts = (contacts) => fetch('/contacts/add', contacts, 'post', '');
/**
 * 修改代理商数据
 */
export const updateCustoms = (customs) => fetch('/customs/update', customs, 'post', '');
/**
 * 插入代理商数据
 */
export const addCustoms = (customs) => fetch('/customs/add', customs, 'post', '');
/**
 * 根据id查询代理商数据
 */
export const findOne = id => fetch('/customs/findOne/' + id);
/**
 * 查所有联想输入
 */
export const findAll = () => fetch('/customs/findAll');
/**
 * 查询企业类型来自as_systemconfig的configType=5和configTypeName
 */
export const findconfigTypeFives = () => fetch('/customs/findconfigTypeFives');
/**
 *  查询证件类型来自as_systemconfig的configType=6和configTypeName
 */
export const findconfigTypeSix = () => fetch('/customs/findconfigTypeSix');
/**
 * 启停代理商数据
 */
export const updateCustomStatus = (id, customStatus) => fetch('/customs/updateCustomStatus/' + id + '/' + customStatus);
/**
 * 批量删除代理商数据
 */
export const deletebyids = (ids) => fetch('/customs/delete', ids, 'post', '');
/**
 * 分页条件查代理商数据
 */
export const search = (customs) => fetch('/customs/search', customs, 'post', '');
/**
 * 修改密码
 */
export const updatepwd = (id, pass) => fetch('/updatepwd/' + id + '/' + pass);
/**
 * 查找账户
 */
export const selectAccount = userId => fetch('/asAccount/selectAccount/' + userId);
/**
 * 查看账户详细
 */
export const selectAccountdetail = (pageNum, pageSize, userId) => fetch('/asAccountdetail/selectAccountdetail/' +
	pageNum + '/' + pageSize + '/' + userId);

/**
 * 报表
 */
export const statement = (url,data) => fetch('/'+url,data);

export const getUserCode = data => fetch('/getUserCode', data, 'post', '');
export const updateMoney = (data) => fetch('/updateMoney', data, 'post', '');
export const queryRole = () => fetch('/queryRole');
export const updateRole = (data) => fetch('/updateRole', data, 'post', '');
export const queryRoleById = (id) => fetch('/queryRoleById',id);
export const insertRole = (data) => fetch('/insertRole', data, 'post', '');
export const deleteRole = (id) => fetch('/deleteRole',id);
export const getUser = (data) => fetch('/getUser', data, 'post', '');
export const getUserById = (id) => fetch('/getUserById',id);
export const updateUser = (data) => fetch('/updateUser', data, 'post', '');
export const insertUser = (data) => fetch('/insertUser', data, 'post', '');
export const deleteUser = (id) => fetch('/deleteUser',id);
export const getAsKeywords = (data) => fetch('/getAsKeywords', data, 'post', '');
// /**
//  * 插入系统配置
//  */
export const insertSystemConfig = (config) => fetch('/insertSystemConfig',config,'post','');
// /**
//  * 根据id删除系统配置
//  */
export const deleteSystemConfig = (id) => fetch('/deleteSystemConfig',id,);
// /**
//  * 根据id修改系统配置
//  */
export const updateSystemConfig = (config) => fetch('/updateSystemConfig',config,'post','');
// /**
//  * 门户列表
//  */
export const queryKeywords = (data) => fetch('/queryKeywords',data,'post','');
// /**
//  * 查看门户信息
//  */
export const queryKeyword = (id) => fetch('/queryKeyword',{id:id});
// /**
//  * 修改关键词信息
//  */
export const updateKeyword = (keyword) => fetch('/updateKeyword',keyword,'post','');
